#!/usr/bin/python

# birthday at same time 
from sets import Set
import random


def draw():
    return random.randint(1,365)
    
def drawTillMatch():
    count = 0
    age = 0
    run = True
    while (run):
        age = draw() 
        if(age not in randomset):
            randomset.add(age)
            count = count + 1  
        else:
            run = False
            #print 'age is', age 
            randomset.clear()
        #print 'The count is:', count
    #print randomset;
    return count
    

randomset = Set()
random.seed()
summa=0
probeNr = 100000

for  j in range (1,probeNr):
    summa = summa + drawTillMatch()
    
print 'avarage of a class is ', summa / float(probeNr)
